<?php

/**
 * Contact filter form base class.
 *
 * @package    erpcrm
 * @subpackage filter
 * @author     Your name here
 * @version    SVN: $Id: sfPropelFormFilterGeneratedTemplate.php 24171 2009-11-19 16:37:50Z Kris.Wallsmith $
 */
abstract class BaseContactFormFilter extends BaseFormFilterPropel
{
  public function setup()
  {
    $this->setWidgets(array(
      'list_name'        => new sfWidgetFormFilterInput(array('with_empty' => false)),
      'first_name'       => new sfWidgetFormFilterInput(array('with_empty' => false)),
      'last_name'        => new sfWidgetFormFilterInput(array('with_empty' => false)),
      'middle_name'      => new sfWidgetFormFilterInput(array('with_empty' => false)),
      'company_name'     => new sfWidgetFormFilterInput(array('with_empty' => false)),
      'contact_category' => new sfWidgetFormFilterInput(array('with_empty' => false)),
      'address'          => new sfWidgetFormFilterInput(array('with_empty' => false)),
      'city'             => new sfWidgetFormFilterInput(array('with_empty' => false)),
      'phone'            => new sfWidgetFormFilterInput(array('with_empty' => false)),
      'fax'              => new sfWidgetFormFilterInput(array('with_empty' => false)),
      'email'            => new sfWidgetFormFilterInput(array('with_empty' => false)),
      'country_name'     => new sfWidgetFormPropelChoice(array('model' => 'ListCountries', 'add_empty' => true, 'key_method' => 'getName')),
      'salutation'       => new sfWidgetFormFilterInput(array('with_empty' => false)),
      'name_suffix'      => new sfWidgetFormFilterInput(array('with_empty' => false)),
      'birthday'         => new sfWidgetFormFilterDate(array('from_date' => new sfWidgetFormDate(), 'to_date' => new sfWidgetFormDate())),
      'remarks'          => new sfWidgetFormFilterInput(array('with_empty' => false)),
      'founding_day'     => new sfWidgetFormFilterDate(array('from_date' => new sfWidgetFormDate(), 'to_date' => new sfWidgetFormDate())),
      'website'          => new sfWidgetFormFilterInput(array('with_empty' => false)),
      'zip_code'         => new sfWidgetFormFilterInput(array('with_empty' => false)),
      'company_initials' => new sfWidgetFormFilterInput(array('with_empty' => false)),
      'cellphone'        => new sfWidgetFormFilterInput(array('with_empty' => false)),
      'pobox'            => new sfWidgetFormFilterInput(array('with_empty' => false)),
      'telex'            => new sfWidgetFormFilterInput(array('with_empty' => false)),
      'person_position'  => new sfWidgetFormFilterInput(array('with_empty' => false)),
      'status'           => new sfWidgetFormFilterInput(array('with_empty' => false)),
    ));

    $this->setValidators(array(
      'list_name'        => new sfValidatorPass(array('required' => false)),
      'first_name'       => new sfValidatorPass(array('required' => false)),
      'last_name'        => new sfValidatorPass(array('required' => false)),
      'middle_name'      => new sfValidatorPass(array('required' => false)),
      'company_name'     => new sfValidatorPass(array('required' => false)),
      'contact_category' => new sfValidatorPass(array('required' => false)),
      'address'          => new sfValidatorPass(array('required' => false)),
      'city'             => new sfValidatorPass(array('required' => false)),
      'phone'            => new sfValidatorPass(array('required' => false)),
      'fax'              => new sfValidatorPass(array('required' => false)),
      'email'            => new sfValidatorPass(array('required' => false)),
      'country_name'     => new sfValidatorPropelChoice(array('required' => false, 'model' => 'ListCountries', 'column' => 'name')),
      'salutation'       => new sfValidatorPass(array('required' => false)),
      'name_suffix'      => new sfValidatorPass(array('required' => false)),
      'birthday'         => new sfValidatorDateRange(array('required' => false, 'from_date' => new sfValidatorDate(array('required' => false)), 'to_date' => new sfValidatorDate(array('required' => false)))),
      'remarks'          => new sfValidatorPass(array('required' => false)),
      'founding_day'     => new sfValidatorDateRange(array('required' => false, 'from_date' => new sfValidatorDate(array('required' => false)), 'to_date' => new sfValidatorDate(array('required' => false)))),
      'website'          => new sfValidatorPass(array('required' => false)),
      'zip_code'         => new sfValidatorPass(array('required' => false)),
      'company_initials' => new sfValidatorPass(array('required' => false)),
      'cellphone'        => new sfValidatorPass(array('required' => false)),
      'pobox'            => new sfValidatorPass(array('required' => false)),
      'telex'            => new sfValidatorPass(array('required' => false)),
      'person_position'  => new sfValidatorPass(array('required' => false)),
      'status'           => new sfValidatorPass(array('required' => false)),
    ));

    $this->widgetSchema->setNameFormat('contact_filters[%s]');

    $this->errorSchema = new sfValidatorErrorSchema($this->validatorSchema);

    parent::setup();
  }

  public function getModelName()
  {
    return 'Contact';
  }

  public function getFields()
  {
    return array(
      'iden'             => 'Text',
      'list_name'        => 'Text',
      'first_name'       => 'Text',
      'last_name'        => 'Text',
      'middle_name'      => 'Text',
      'company_name'     => 'Text',
      'contact_category' => 'Text',
      'address'          => 'Text',
      'city'             => 'Text',
      'phone'            => 'Text',
      'fax'              => 'Text',
      'email'            => 'Text',
      'country_name'     => 'ForeignKey',
      'salutation'       => 'Text',
      'name_suffix'      => 'Text',
      'birthday'         => 'Date',
      'remarks'          => 'Text',
      'founding_day'     => 'Date',
      'website'          => 'Text',
      'zip_code'         => 'Text',
      'company_initials' => 'Text',
      'cellphone'        => 'Text',
      'pobox'            => 'Text',
      'telex'            => 'Text',
      'person_position'  => 'Text',
      'status'           => 'Text',
    );
  }
}
